﻿using System;
using System.Windows.Automation;

namespace QuickUIT.Controls
{
    /// <summary>
    /// Represents a pane control. 
    /// </summary>
    public class UIPane : UIBaseControl
    {
        /// <summary>
        /// Gets the dock position of the control. 
        /// </summary>
        public new DockPosition? DockPosition
        {
            get { return base.DockPosition; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be resized. 
        /// </summary>
        public new bool CanResize
        {
            get { return base.CanResize; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be moved. 
        /// </summary>
        public new bool CanMove
        {
            get { return base.CanMove; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can be rotated. 
        /// </summary>
        public new bool CanRotate
        {
            get { return base.CanRotate; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool HorizontallyScrollable
        {
            get { return base.HorizontallyScrollable; }
        }

        /// <summary>
        /// Gets a value which indicates whether the control can scroll horizontally. 
        /// </summary>
        public new bool VerticallyScrollable
        {
            get { return base.VerticallyScrollable; }
        }

        /// <summary>
        /// Gets the value of the horizontal scroll position.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN. 
        /// </summary>
        public new double HorizontalScrollPercent
        {
            get { return base.HorizontalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the vertical scroll position 
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalScrollPercent
        {
            get { return base.VerticalScrollPercent; }
        }

        /// <summary>
        /// Gets the value of the horizontal size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double HorizontalViewSize
        {
            get { return base.HorizontalViewSize; }
        }

        /// <summary>
        /// Gets the value of the vertical size of the viewable region.
        /// If the control does not support the <see cref="ScrollPattern"/>, returns NaN.
        /// </summary>
        public new double VerticalViewSize
        {
            get { return base.VerticalViewSize; }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class. 
        /// </summary>
        public UIPane()
            : base(ControlType.Pane)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        public UIPane(UIBaseControl parent)
            : base(parent, ControlType.Pane)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class.
        /// </summary>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIPane(string locator)
            : base(null, ControlType.Pane, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class.
        /// </summary>
        /// <param name="parent">The parent of this control.</param>
        /// <param name="locator">The locator used to find the specific control.</param>
        public UIPane(UIBaseControl parent, string locator)
            : base(parent, ControlType.Pane, locator)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class.
        /// </summary>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIPane(AutomationElement control) : base(control, ControlType.Pane)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="UIPane"/> class.
        /// </summary>
        /// <param name="parent">The parent of the control</param>
        /// <param name="control">The underlying <see cref="AutomationElement"/> of the control.</param>
        public UIPane(UIBaseControl parent, AutomationElement control) : base(parent, control, ControlType.Pane)
        {
        }

        /// <summary>
        /// Sets the dock position of the control.
        /// </summary>
        /// <param name="dockPosition">The new dock position.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Dock(DockPosition dockPosition)
        {
            base.Dock(dockPosition);
        }

        /// <summary>
        /// Scrolls the visible region of the content area horizontally and vertically. 
        /// </summary>
        /// <param name="horizontalAmount">The horizontal scrolling increment that is specific to the control.</param>
        /// <param name="verticalAmount">The vertical scrolling increment that is specific to the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        /// <remarks>No scroll should be passed if if the control cannot be scrolled in a given direction.</remarks>
        public new void Scroll(ScrollAmount horizontalAmount, ScrollAmount verticalAmount)
        {
            base.Scroll(horizontalAmount, verticalAmount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area vertically by a <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The vertical scrolling increment.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void ScrollVertically(ScrollAmount amount)
        {
            base.ScrollVertically(amount);
        }

        /// <summary>
        /// Scrolls the visble region of the content area horizontally by a <see cref="ScrollAmount"/>.
        /// </summary>
        /// <param name="amount">The horizontal scrolling increment.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void ScrollHorizontally(ScrollAmount amount)
        {
            base.ScrollHorizontally(amount);
        }

        /// <summary>
        /// Sets the horizontal and vertical scroll position as a percentage of the total content area within the control. 
        /// </summary>
        /// <param name="horizontalPercent">
        /// The percentage of the total horizontal content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        /// <param name="verticalPercent">
        /// The percentage of the total vertical content area. 
        /// <see cref="ScrollPattern.NoScroll"/> should be passed in if the control cannot be scrolled in this direction.
        /// </param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void SetScrollPercent(double horizontalPercent, double verticalPercent)
        {
            base.SetScrollPercent(horizontalPercent, verticalPercent);
        }

        /// <summary>
        /// Moves the pane. 
        /// </summary>
        /// <param name="x">Absolute screen coordinates of the left side of the control.</param>
        /// <param name="y">Absolute screen coordinates of the top of the control.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Move(double x, double y)
        {
            base.Move(x, y);
        }

        /// <summary>
        /// Resizes the pane. 
        /// </summary>
        /// <param name="width">The new width of the window, in pixels.</param>
        /// <param name="height">The new height of the window, in pixels.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Resize(double width, double height)
        {
            base.Resize(width, height);
        }

        /// <summary>
        /// Rotates the pane. 
        /// </summary>
        /// <param name="degrees">The number of degrees to rotate the control. A positive number rotates clockwise; a negative number rotates counterclockwise.</param>
        /// <exception cref="InvalidOperationException">The control pattern cannot be performed by the element.</exception>
        /// <exception cref="ElementNotAvailableException">The element is not available anymore.</exception>
        public new void Rotate(double degrees)
        {
            base.Rotate(degrees);
        }
    }
}
